import { DashboardOne, DocDetail, ImageFiles, Setting, Film, User, Ticket } from '@icon-park/vue-next'
import { RouteRecordRaw } from 'vue-router'
const comMap = reactive([markRaw(DashboardOne), markRaw(DocDetail), markRaw(ImageFiles), markRaw(Setting), markRaw(Film), markRaw(User), markRaw(Ticket)]);
export default [
  {
    path: '/',
    redirect: "/admin"
  },
  {
    name: "admin",
    path: '/admin',
    component: () => import('@/layouts/admin/index.vue'),
    meta: { auth: true, menu: { title: '工作台', icon: DashboardOne, order: 100 }, permission: 'user' },
    children: [
      {
        name: 'admin.dashboard.index',
        path: 'dashboard/index',
        component: () => import('@/views/admin/dashboard/index.vue'),
        meta: { title: '首页统计', menu: { title: '首页统计' }, permission: 'user' },
      },
    ],
  },
  {
    name: "admin.merchant",
    path: "/merchant",
    component: () => import('@/layouts/admin/index.vue'),
    meta: { auth: true, menu: { title: '商家', icon: DocDetail, order: 100 }, permission: 'user' },
    children: [
      {
        name: 'admin.merchant.index',
        path: 'index',
        component: () => import('@/views/admin/merchant/index.vue'),
        meta: { title: '商家管理', menu: { title: '商家管理' }, permission: 'user' },
      },
      {
        name: 'admin.merchant.show',
        path: 'show/:id',
        component: () => import('@/views/admin/merchant/show.vue'),
        meta: { title: '商家详情', menu: { title: '商家详情' }, permission: 'user', hidden: true },
      },
      {
        name: 'admin.merchant.edit',
        path: 'edit/:id',
        component: () => import('@/views/admin/merchant/edit.vue'),
        meta: { title: '商家编辑', menu: { title: '商家编辑' }, permission: 'user', hidden: true },
      },
    ],
  },
  {
    name: "admin.member",
    path: "/member",
    component: () => import('@/layouts/admin/index.vue'),
    meta: { auth: true, menu: { title: '会员', icon: User, order: 100 }, permission: 'user' },
    children: [
      {
        name: 'admin.member.index',
        path: 'index',
        component: () => import('@/views/admin/member/index.vue'),
        meta: { title: '会员管理', menu: { title: '会员管理' }, permission: 'user' },
      },
      {
        name: 'admin.member.rewardconfirm',
        path: 'rewardconfirm',
        component: () => import('@/views/admin/member/rewardconfirm.vue'),
        meta: { title: '奖励', menu: { title: '奖励' }, permission: 'user' },
      },
      {
        name: 'admin.member.rewardshow',
        path: ':id/rewardshow',
        component: () => import('@/views/admin/member/rewardshow.vue'),
        meta: { title: '奖励', menu: { title: '奖励' }, permission: 'user', hidden: true },
      },
      {
        name: 'admin.member.quit',
        path: 'quit',
        component: () => import('@/views/admin/member/quit.vue'),
        meta: { title: '退会审批', menu: { title: '退会审批' }, permission: 'user' },
      },
    ],
  },
  {
    name: "admin.order",
    path: "/order",
    component: () => import('@/layouts/admin/index.vue'),
    meta: { auth: true, menu: { title: '订单', icon: Ticket, order: 100 }, permission: 'user' },
    children: [
      {
        name: 'admin.order.index',
        path: 'index',
        component: () => import('@/views/admin/order/index.vue'),
        meta: { title: '资金订单', menu: { title: '资金订单' }, permission: 'user' },
      },
    ],
  },
  {
    name: "admin.config",
    path: "/config",
    component: () => import('@/layouts/admin/index.vue'),
    meta: { auth: true, menu: { title: '系统配置', icon: Setting, order: 100 }, permission: 'user' },
    children: [
      {
        name: 'admin.config.edit',
        path: 'index',
        component: () => import('@/views/admin/config/edit.vue'),
        meta: { title: '系统参数', menu: { title: '系统参数' }, permission: 'user' },
      },
      {
        name: 'admin.config.category',
        path: 'category',
        component: () => import('@/views/admin/config/category.vue'),
        meta: { title: '商家类别', menu: { title: '商家类别' }, permission: 'user' },
      },
      {
        name: 'admin.config.discount',
        path: 'discount',
        component: () => import('@/views/admin/config/discount.vue'),
        meta: { title: '优惠配置', menu: { title: '优惠配置' }, permission: 'user' },
      },
    ],
  },
  {
    name: "admin.swiper",
    path: "/swiper",
    component: () => import('@/layouts/admin/index.vue'),
    meta: { auth: true, menu: { title: '轮播配置', icon: Film, order: 100 }, permission: 'user' },
    children: [
      {
        name: 'admin.swiper.index',
        path: 'index',
        component: () => import('@/views/admin/swiper/index.vue'),
        meta: { title: '轮播', menu: { title: '轮播' }, permission: 'user' },
      },
    ],
  },

] as RouteRecordRaw[]
